home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
ai
/
pdproprg.lzh
/
CONSOLE.PRO
< prev
next >
Wrap
Text File
|
1985-12-31
|
640b
|
19 lines
get_answer( A ) :-
ratom( X ), name( X, String ),
valid_resp( String, A ), !.
valid_resp( [H|T], A ) :- type_ans( H, A ).
type_ans( X, A ) :- ([X] = "y"; [X] = "Y"), A = yes.
type_ans( X, A ) :- ([X] = "n"; [X] = "N"), A = no.
type_ans( X, A ) :- ([X] = "w"; [X] = "W"), A = why.
?-print('\nYou can start animal by typing "help.<CR>"\n' ).
valid_resp( [], A ) :-
print('\nPlease try to give me a yes or no answer.'),
get_answer( A ), !.
valid_resp( [H|T], A ) :- valid_resp( T, A ).